<template>
<el-dialog :visible.sync="visible" title="详情" :close-on-click-modal="false" :close-on-press-escape="false" @close="close()" :destroy-on-close="true" @opened="opened()" width="70%" top="90px">
    <el-form :model="dataForm" label-position="right" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '140px' : '130px'">
        <el-row>
            <h3 style="margin-top:-20px">企业基本信息</h3>
            <el-col :span="24">
                <el-form-item label="企业名称" prop="name">
                    {{dataForm.name||'--'}}
                </el-form-item>
            </el-col>
            <el-col :span="6">
                <el-form-item label="企业编码" prop="code" align="left">
                    {{dataForm.code||'--'}}
                </el-form-item>
            </el-col>
            <el-col :span="6">
                <el-form-item label="企业法人" prop="legalPerson">
                    {{dataForm.legalPerson||'--'}}
                </el-form-item>
            </el-col>
            <el-col :span="6">
                <el-form-item label="经营项目" prop="operateProject">
                    {{dataForm.operateProject||'--'}}
                </el-form-item>
            </el-col>
            <el-col :span="6">
                <el-form-item label="经营时间" prop="operateTime">
                    {{dataForm.operateTime||'--'}}
                </el-form-item>
            </el-col>
           

            <el-col :span="6">
                <el-form-item label="派出所代码" prop="policeCode">
                    {{dataForm.policeCode||'--'}}
                </el-form-item>
            </el-col>
            <el-col :span="6">
                <el-form-item label="产权人类型" prop="ownerType">
                    {{$getDictLabel('hotel_operator_type',dataForm.legalPerson)}}
                </el-form-item>
            </el-col>
            <el-col :span="6">
                <el-form-item label="经营人证件类型" prop="operatorCardType">
                    {{$getDictLabel('hotel_operator_card_type',dataForm.operatorCardType)}}
                </el-form-item>
            </el-col>
            <el-col :span="6">
                <el-form-item label="经营人证件号" prop="operatorCard">
                    {{dataForm.operatorCard||'--'}}
                </el-form-item>
            </el-col>
            <el-col :span="6">
                <el-form-item label="注册登记号" prop="registerNo">
                    {{dataForm.registerNo}}
                </el-form-item>
            </el-col>
            <el-col :span="6">
                <el-form-item label="是否自动退房" prop="isCheckOut">
                    {{dataForm.isCheckOut?'是':'否'}}
                </el-form-item>
            </el-col>
            <el-col :span="6">
                <el-form-item label="是否需要身份证" prop="isNeedCard">
                    {{dataForm.isNeedCard?'是':'否'}}
                </el-form-item>
            </el-col>
            <el-col :span="6">
                <el-form-item label="是否需要结算" prop="isSettlement">
                    {{dataForm.isSettlement?'是':'否'}}
                </el-form-item>
            </el-col>
            <el-col :span="6" v-if="dataForm.isCheckOut==1">
                <el-form-item label="自动退房时间" prop="checkOutTime">
                    {{dataForm.checkOutTime||'--'}}
                </el-form-item>
            </el-col>
             <el-col :span="6">
                <el-form-item label="实际经营人类型" prop="operatorType">
                    {{$getDictLabel('hotel_operator_type',dataForm.legalPerson)}}
                </el-form-item>
            </el-col>
            <el-col :span="6">
                <el-form-item label="实际经营人姓名" prop="operatorName">
                    {{dataForm.legalPerson||'--'}}
                </el-form-item>
            </el-col>
            <el-col :span="6">
                <el-form-item label="经营人单位名称" prop="operatorUnit">
                    {{dataForm.operatorUnit||'--'}}
                </el-form-item>
            </el-col>
            <el-col :span="6">
                <el-form-item label="统一社会信用代码" prop="creditCode">
                    {{dataForm.creditCode||'--'}}
                </el-form-item>
            </el-col>
             <el-col :span="12">
                <el-form-item label="所在地址" prop="">
                    {{dataForm.province}}-{{dataForm.city}}-{{dataForm.area}}-{{dataForm.street}}-{{dataForm.areaDetail}}
                </el-form-item>
            </el-col>
            <el-col :span="12">
                <el-form-item label="适用人群" prop="forPeople">
                    {{dataForm.forPeople||'--'}}
                </el-form-item>
            </el-col>
        </el-row>
        <el-row>
            <h3>企业联系人信息</h3>
            <el-col :span="6">
                <el-form-item label="联系人姓名" prop="linkName">
                    {{dataForm.linkName||'--'}}
                </el-form-item>
            </el-col>
            <el-col :span="6">
                <el-form-item label="联系人号码" prop="linkPhone">
                    {{dataForm.linkPhone||'--'}}
                </el-form-item>
            </el-col>
            <el-col :span="6">
                <el-form-item label="管理员用户名" prop="adminName">
                    {{dataForm.adminName||'--'}}
                </el-form-item>
            </el-col>
            <el-col :span="6">
                <el-form-item label="管理员密码" prop="adminPassword">
                    {{dataForm.adminPassword||'--'}}
                </el-form-item>
            </el-col>
           
        </el-row>
    </el-form>
</el-dialog>
</template>

<script>
import debounce from "lodash/debounce";
import mixinRegionModule from "@/mixins/region-module";
export default {
    mixins: [mixinRegionModule],

    data() {
        return {
            selectValue: "1111",
            value: "",
            processOptions: [{
                    dictValue: "0",
                    dictLabel: "待审核",
                },
                {
                    dictValue: "1",
                    dictLabel: "审核通过",
                },
                {
                    dictValue: "2",
                    dictLabel: "审核不通过",
                },
            ],
            statusValue: "",
            visible: false,
            dataForm: {
                id: "",
                name: "",
                code: "",
                legalPerson: "",
                operatorType: "",
                operatorName: "",
                operatorUnit: "",
                creditCode: "",
                operatorCardType: "",
                policeCode: "",
                ownerType: "",
                operatorCard: "",
                registerNo: "",
                operateProject: "",
                operateTime: "",
                areaCode: "",
                areaDetail: "",
                isCheckOut: "",
                isNeedCard: "",
                isSettlement: "",
                checkOutTime: "",
                linkName: "",
                linkPhone: "",
                adminName: "",
                adminPassword: "",
                process: "",
                status: "",
                delFlag: "",
                remark: "",
                creator: "",
                createDate: "",
                updater: "",
                updateDate: "",
            },
        };
    },
    props: {
        disabled: Boolean
    },
    methods: {
        opened() {
            this.provincAreaDetailInfoList();
            if (this.dataForm.city) {
                this.cityAreaDetailInfoList(this.dataForm.province);
            }
            if (this.dataForm.area) {
                this.countyAreaDetailInfoList(this.dataForm.city);
            }
        },
        close() {
            this.dataForm = {
                id: "",
                name: "",
                code: "",
                legalPerson: "",
                operatorType: "",
                operatorName: "",
                operatorUnit: "",
                creditCode: "",
                operatorCardType: "",
                policeCode: "",
                ownerType: "",
                operatorCard: "",
                registerNo: "",
                operateProject: "",
                operateTime: "",
                areaCode: "",
                areaDetail: "",
                isCheckOut: "",
                isNeedCard: "",
                isSettlement: "",
                checkOutTime: "",
                linkName: "",
                linkPhone: "",
                adminName: "",
                adminPassword: "",
                process: "",
                status: "",
                delFlag: "",
                remark: "",
                creator: "",
                createDate: "",
                updater: "",
                updateDate: "",
            };
            this.$emit("changeDisabled");
        },

        init() {
            this.visible = true;
            this.$nextTick(() => {
                this.$refs["dataForm"].resetFields();
                if (this.dataForm.id) {
                    this.getInfo();
                }
            });
        },
        // 获取信息
        getInfo() {
            this.$http
                .get("/sys/ishotelhomestay/" + this.dataForm.id)
                .then(({
                    data: res
                }) => {
                    if (res.code !== 0) {
                        return this.$message.error(res.msg);
                    }
                    this.dataForm = {
                        ...this.dataForm,
                        ...res.data.dto,
                    };
                    this.dataForm.ownerType = this.dataForm.ownerType + "";
                    this.dataForm.operatorCardType = this.dataForm.operatorCardType + "";
                    this.dataForm.operatorType = this.dataForm.operatorType + "";

                    this.$refs.operatorType.selectValue = this.dataForm.operatorType;
                    this.$refs.operatorCardType.selectValue =
                        this.dataForm.operatorCardType;
                    this.$refs.ownerType.selectValue = this.dataForm.ownerType;
                })
                .catch(() => {});
        },
    },
};
</script>

<style lang="scss" scoped>
h3 {
    padding: 30px 0 15px;
    width: 97%;
    border-bottom: 1px solid #ddd;
    color: #303133;
    margin-left:1%;
    font-size: 22px;
    overflow: hidden;
}

::v-deep .el-form-item__label{
  color:#111;
}
</style>
